#如果project_name为www，那一个服务器上部署多个网站时会冲突，比如www.doubanxia.com 和 www.shaixuan.org 都是www
version = trunk
#环境有：dev、prod
env = dev
upload_user = root
release_user = root
server = movie.$(env).intra.doubanxia.com
code_dir = /usr/local/php/lib/php/
upload:
	@rm -rf ../tmp/; svn up; svn export ./php/sql_maker/ ../tmp/;
	@cd ../tmp/; tar -zcvf ../tmp.bz2 ./;
	@scp ../tmp.bz2 $(upload_user)@$(server):$(code_dir);
	@rm -rf ../tmp/;
	@ssh $(upload_user)@$(server) 'cd $(code_dir); tar -zxvf tmp.bz2;'
	@echo upload to $(env) ok
	@exit
release:
	@ssh $(release_user)@$(server) 'cd $(code_dir); cp -R ./* ../enabled/; cp nginx/conf/sites-enabled/movie.doubanxia.com.conf $(nginx_conf_dir); /usr/local/nginx/sbin/nginx -s reload;'
	@echo release ok
